all:bin/totem

main:bin/main.o
GameModel:bin/GameModel.o
Player:bin/Player.o
Settings:bin/Settings.o
View:bin/View.o
PlayerModel:bin/PlayerModel.o
Card:bin/Card.o
Connector: bin/Connector.o
NetworkConnector: bin/NetworkConnector.o
ServerConnector: bin/ServerConnector.o
StringParser: bin/StringParser.o
CommandMaker: bin/CommandMaker.o
Logger: bin/Logger.o

bin/main.o: src/main.cpp src/Model/GameModel.h src/Model/PlayerModel.h src/Model/Card.h src/Interface/Player.h \
        src/Settings/Settings.h src/Interface/View.h src/Connector/Connector.h
	g++ -c src/main.cpp -o bin/main.o

bin/GameModel.o: src/Model/GameModel.cpp src/Model/GameModel.h src/Model/PlayerModel.h src/Model/Card.h
	g++ -c src/Model/GameModel.cpp -o bin/GameModel.o

bin/Player.o: src/Interface/Player.cpp src/Interface/Player.h src/Model/GameModel.h src/Model/PlayerModel.h \
          src/Model/Card.h src/Settings/Settings.h
	g++ -c src/Interface/Player.cpp -o bin/Player.o

bin/Settings.o: src/Settings/Settings.cpp src/Settings/Settings.h
	g++ -c src/Settings/Settings.cpp -o bin/Settings.o

bin/View.o: src/Interface/View.cpp src/Interface/View.h src/Interface/Player.h src/Model/GameModel.h \
        src/Model/PlayerModel.h src/Model/Card.h src/Settings/Settings.h src/Connector/NetworkConnector.h \
        src/Connector/Connector.h
	g++ -c src/Interface/View.cpp -o bin/View.o

bin/PlayerModel.o: src/Model/PlayerModel.cpp src/Model/PlayerModel.h src/Model/Card.h
	g++ -c src/Model/PlayerModel.cpp -o bin/PlayerModel.o

bin/Card.o: src/Model/Card.cpp src/Model/Card.h
	g++ -c src/Model/Card.cpp -o bin/Card.o

bin/Logger.o: src/Logger/Logger.cpp src/Logger/Logger.h
	g++ -c src/Logger/Logger.cpp -o bin/Logger.o

bin/Connector.o: src/Connector/Connector.cpp src/Connector/Connector.h src/Model/GameModel.h \
                  src/Model/PlayerModel.h src/Model/Card.h
	g++ -c src/Connector/Connector.cpp -o bin/Connector.o

bin/NetworkConnector.o: src/Connector/NetworkConnector.cpp src/Connector/NetworkConnector.h \
                        src/Connector/Connector.h src/Model/GameModel.h src/Model/PlayerModel.h\
                        src/Model/Card.h src/Logger/Logger.h src/Connector/StringParser.h
	g++ -c src/Connector/NetworkConnector.cpp -o bin/NetworkConnector.o

bin/ServerConnector.o: src/Connector/ServerConnector.cpp src/Connector/ServerConnector.h \
                       src/Connector/Connector.h src/Model/GameModel.h src/Model/PlayerModel.h \
                       src/Model/Card.h src/Settings/Settings.h src/Logger/Logger.h src/Connector/StringParser.h
	g++ -c src/Connector/ServerConnector.cpp -o bin/ServerConnector.o

bin/StringParser.o: src/Connector/StringParser.cpp src/Connector/StringParser.h src/Settings/Settings.h \
                    src/Model/Card.h
	g++ -c src/Connector/StringParser.cpp -o bin/StringParser.o

bin/CommandMaker.o: src/Connector/CommandMaker.cpp src/Connector/CommandMaker.h src/Settings/Settings.h \
                    src/Model/Card.h
	g++ -c src/Connector/CommandMaker.cpp -o bin/CommandMaker.o



bin/totem: bin/main.o bin/GameModel.o bin/Player.o bin/Settings.o bin/View.o bin/PlayerModel.o \
           bin/Card.o bin/Connector.o bin/NetworkConnector.o bin/ServerConnector.o bin/Logger.o \
           bin/StringParser.o bin/CommandMaker.o
	g++ bin/main.o bin/GameModel.o bin/Player.o bin/Settings.o bin/View.o bin/PlayerModel.o \
            bin/Card.o bin/Connector.o bin/NetworkConnector.o bin/ServerConnector.o bin/Logger.o \
            bin/StringParser.o bin/CommandMaker.o -o bin/totem -lncurses

clean:
	rm bin/totem bin/main.o bin/GameModel.o bin/Player.o bin/Settings.o bin/View.o bin/PlayerModel.o \
           bin/Connector.o bin/NetworkConnector.o bin/ServerConnector.o bin/Card.o bin/Logger.o bin/StringParser.o\
           bin/CommandMaker

run: 
	./bin/totem

test:bin/test

UnitTest:bin/UnitTest.o
TestRules:bin/TestRules.o
BotTest:bin/BotTest.o

bin/UnitTest.o: src/Test/UnitTest.cpp src/Test/UnitTest.h
	g++ -c src/Test/UnitTest.cpp -o bin/UnitTest.o

bin/TestRules.o: src/Test/TestRules.cpp src/Test/TestRules.h src/Test/UnitTest.h src/Model/GameModel.h \
             src/Model/PlayerModel.h src/Model/Card.h src/Interface/Player.h src/Settings/Settings.h \
             src/Connector/Connector.h
	g++ -c src/Test/TestRules.cpp -o bin/TestRules.o

bin/BotTest.o: src/Test/BotTest.cpp src/Test/BotTest.h src/Test/UnitTest.h src/Model/GameModel.h \
             src/Model/PlayerModel.h src/Model/Card.h src/Interface/Player.h src/Settings/Settings.h \
             src/Connector/Connector.h src/Logger/Logger.h
	g++ -c src/Test/BotTest.cpp -o bin/BotTest.o

bin/mainTest.o: src/Test/mainTest.cpp src/Test/BotTest.h src/Test/UnitTest.h src/Logger/Logger.h
	g++ -c src/Test/mainTest.cpp -o bin/mainTest.o

bin/test: bin/mainTest.o bin/UnitTest.o bin/BotTest.o bin/GameModel.o bin/PlayerModel.o \
          bin/Card.o bin/Player.o bin/Settings.o bin/Connector.o bin/Logger.o
	g++ bin/mainTest.o bin/UnitTest.o bin/BotTest.o bin/GameModel.o bin/PlayerModel.o bin/Card.o \
            bin/Player.o bin/Settings.o bin/Connector.o bin/Logger.o -o bin/test

cleanTest:
	rm bin/test bin/mainTest.o bin/UnitTest.o bin/BotTest.o bin/GameModel.o bin/PlayerModel.o \
           bin/Card.o bin/Player.o bin/Settings.o bin/Connector.o bin/Logger.o
runTest:
	./bin/test
